<template>
	<view class="content">

		<metab v-model="current" :tabs="tabs" @change="changeTab" ></metab>
		<!-- 热映 -->
		<view v-if="current === 0" >
	 <scroll-view class="" scroll-y="true" 
	    refresher-enabled="false"
	    refresher-triggered="triggered"
	    bindscrolltolower="tolowered"
	     bindrefresherrefresh="refreshmove"  :style="{height:windowHeight+'px'}">
	        <!-- <block v-for=" item in movieList" :key="item.id"> -->
	        <navigator url="/pages/detail/detail?id='cesi.id'">
	        <cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>			
			<cart :movieData="cesi"></cart><cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
			<cart :movieData="cesi"></cart>
				
	            </navigator>
	           
	        <!-- </block> -->
	   
	    </scroll-view>
	   
		</view>
		<view v-else >2</view>
	</view>

</template>

	
<script>
	import  metab  from '@/components/v-tabs/v-tabs.vue'
	import cart from '@/components/cart/cart.vue'
	    import store from '@/store/index.js';//需要引入store
	export default {
		data() {
			return {
				title: "asd",
				current:0,
				tabs:["热映","待映"],
				windowHeight:"",
				      cesi:{
				            id: 1277950,
				                haspromotionTag: false,
				                img: "http://p0.meituan.net/mmdb/f43ca3ba4dac4a79725fbeadc376b93b7233438.png",
				                version: "v2d imax",
				                nm: "反贪风暴5：最终章",
				                preShow: false,
				                sc: 8.8,
				                globalReleased: true,
				                wish: 853008,
				                star: "古天乐,张智霖,郑嘉颖",
				                rt: "2021-12-31",
				                showInfo: "今天244家影院放映3086场",
				            showst: 3,
				                wishst: 0,
				                comingTitle: "2021年12月31日 周五",
				                showStateButton: {
				        color: "#F03D37",
				               content: "购票",
				                onlyPreShow: false,
				                shadowColor: "rgba(240,61,55, 0.15)"
				                }
				        }
			}
		},
		onLoad() {
				console.log(store.getters['user/getusername'])
			// console.log( Object.prototype.toString.call(store.getters) )
			// for( var  key  in store.getters ){
			// 	console.log(key)
			// 		console.log(store.getters[key])
			// }
			this.setWindowHeight()
		},
		methods: {
		changeTab(index){
			console.log(index)
		},
		 setWindowHeight(){
		        wx.getSystemInfo(
		            {
		                success:(res)=>{
							console.log("获取高度",  res.windowHeight,res.windowBottom)
		                        this.windowHeight=res.windowHeight	
									//ifndef H5
									this.windowHeight=res.windowHeight-40	
									//endif
		                }
		            }
		        )
		    },
		},
		components:{
			metab,
			cart
		}
	}
</script>

<style>


</style>
